package com.zspace.lwq.consumer.service.impl;

import com.zspace.lwq.user.bean.UserAddress;
import com.zspace.lwq.user.service.UserService;

import java.util.List;

/**
 * 本地存根，使用调用的拦截
 */
public class UserServiceStub implements UserService {

    private UserService userService;
    // 远程代理对象
    public UserServiceStub(UserService userService) {
        this.userService = userService;
    }

    @Override
    public List<UserAddress> getUserAddressList(String userId) {
        System.out.println("invoke before");
        List<UserAddress> userAddressList = userService.getUserAddressList(userId);
        System.out.println("invoke after");
        return userAddressList;
    }
}
